
import 'package:json_annotation/json_annotation.dart';

part 'goods_detail_entity.g.dart';

@JsonSerializable()
class GoodsDetailEntity {
  List<GoodsDetailSpecificationlist>? specificationList;
  List<dynamic>? groupon; // Using dynamic here as it is a List<Null>
  List<GoodsDetailIssue>? issue;
  int? userHasCollect;
  String? shareImage;
  GoodsDetailComment? comment;
  bool? share;
  List<GoodsDetailAttribute>? attribute;
  GoodsDetailBrand? brand;
  List<GoodsDetailProductlist>? productList;
  GoodsDetailInfo? info;

  GoodsDetailEntity({
    this.specificationList,
    this.groupon,
    this.issue,
    this.userHasCollect,
    this.shareImage,
    this.comment,
    this.share,
    this.attribute,
    this.brand,
    this.productList,
    this.info,
  });

  factory GoodsDetailEntity.fromJson(Map<String, dynamic> json) => _$GoodsDetailEntityFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailEntityToJson(this);
}

@JsonSerializable()
class GoodsDetailSpecificationlist {
  List<GoodsDetailSpecificationlistValuelist>? valueList;
  String? name;

  GoodsDetailSpecificationlist({
    this.valueList,
    this.name,
  });

  factory GoodsDetailSpecificationlist.fromJson(Map<String, dynamic> json) => _$GoodsDetailSpecificationlistFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailSpecificationlistToJson(this);
}

@JsonSerializable()
class GoodsDetailSpecificationlistValuelist {
  String? picUrl;
  bool? deleted;
  String? addTime;
  int? goodsId;
  String? specification;
  String? updateTime;
  int? id;
  String? value;

  GoodsDetailSpecificationlistValuelist({
    this.picUrl,
    this.deleted,
    this.addTime,
    this.goodsId,
    this.specification,
    this.updateTime,
    this.id,
    this.value,
  });

  factory GoodsDetailSpecificationlistValuelist.fromJson(Map<String, dynamic> json) => _$GoodsDetailSpecificationlistValuelistFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailSpecificationlistValuelistToJson(this);
}



@JsonSerializable()
class GoodsDetailIssue {
  bool? deleted;
  String? question;
  String? answer;
  String? addTime;
  String? updateTime;
  int? id;

  GoodsDetailIssue({
    this.deleted,
    this.question,
    this.answer,
    this.addTime,
    this.updateTime,
    this.id,
  });

  factory GoodsDetailIssue.fromJson(Map<String, dynamic> json) => _$GoodsDetailIssueFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailIssueToJson(this);
}

@JsonSerializable()
class GoodsDetailComment {
  List<GoodsDetailCommentModel>? data; // Using dynamic here as it is a List<Null>
  int? count;

  GoodsDetailComment({
    this.data,
    this.count,
  });

  factory GoodsDetailComment.fromJson(Map<String, dynamic> json) => _$GoodsDetailCommentFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailCommentToJson(this);
}

@JsonSerializable()
class GoodsDetailCommentModel {
  String? addTime;
  List<String>? picList;
  String? adminContent;
  String? nickname;
  int? id;
  String? avatar;
  String? content;

  GoodsDetailCommentModel({
    this.addTime,
    this.picList,
    this.adminContent,
    this.nickname,
    this.id,
    this.avatar,
    this.content,
  });

 Map<String, dynamic> toJson() => _$GoodsDetailCommentModelToJson(this);
  factory GoodsDetailCommentModel.fromJson(Map<String, dynamic> json) => _$GoodsDetailCommentModelFromJson(json);
}


@JsonSerializable()
class GoodsDetailAttribute {
  bool? deleted;
  String? addTime;
  int? goodsId;
  String? updateTime;
  int? id;
  String? attribute;
  String? value;

  GoodsDetailAttribute({
    this.deleted,
    this.addTime,
    this.goodsId,
    this.updateTime,
    this.id,
    this.attribute,
    this.value,
  });

  factory GoodsDetailAttribute.fromJson(Map<String, dynamic> json) => _$GoodsDetailAttributeFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailAttributeToJson(this);
}

@JsonSerializable()
class GoodsDetailBrand {
  double? floorPrice;
  String? picUrl;
  bool? deleted;
  String? addTime;
  int? sortOrder;
  String? name;
  String? updateTime;
  int? id;
  String? desc;

  GoodsDetailBrand({
    this.floorPrice,
    this.picUrl,
    this.deleted,
    this.addTime,
    this.sortOrder,
    this.name,
    this.updateTime,
    this.id,
    this.desc,
  });

  factory GoodsDetailBrand.fromJson(Map<String, dynamic> json) => _$GoodsDetailBrandFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailBrandToJson(this);
}


@JsonSerializable()
class GoodsDetailProductlist {
  int? number;
  bool? deleted;
  String? addTime;
  int? goodsId;
  double? price;
  String? updateTime;
  int? id;
  List<String>? specifications;
  String? url;

  GoodsDetailProductlist({
    this.number,
    this.deleted,
    this.addTime,
    this.goodsId,
    this.price,
    this.updateTime,
    this.id,
    this.specifications,
    this.url,
  });

  factory GoodsDetailProductlist.fromJson(Map<String, dynamic> json) => _$GoodsDetailProductlistFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailProductlistToJson(this);
}

@JsonSerializable()
class GoodsDetailInfo {
  String? brief;
  String? keywords;
  String? addTime;
  String? goodsSn;
  String? updateTime;
  bool? isNew;
  String? picUrl;
  String? unit;
  bool? deleted;
  int? brandId;
  int? sortOrder;
  String? name;
  String? shareUrl;
  double? counterPrice;
  int? id;
  String? detail;
  bool? isOnSale;
  double? retailPrice;
  int? categoryId;
  List<String>? gallery;
  bool? isHot;

  GoodsDetailInfo({
    this.brief,
    this.keywords,
    this.addTime,
    this.goodsSn,
    this.updateTime,
    this.isNew,
    this.picUrl,
    this.unit,
    this.deleted,
    this.brandId,
    this.sortOrder,
    this.name,
    this.shareUrl,
    this.counterPrice,
    this.id,
    this.detail,
    this.isOnSale,
    this.retailPrice,
    this.categoryId,
    this.gallery,
    this.isHot,
  });

  factory GoodsDetailInfo.fromJson(Map<String, dynamic> json) => _$GoodsDetailInfoFromJson(json);

  Map<String, dynamic> toJson() => _$GoodsDetailInfoToJson(this);
}


